/**
 * @param {string} s
 * @return {boolean}
 */
var isValid = function (s) {
    let array = s.split('');
    if (array.length % 2 !== 0) {
        return false;
    }
    let news = s;
    news = news.split('()').join('');
    news = news.split('{}').join('');
    news = news.split('[]').join('');
    if (news === '') {
        return true;
    }
    return news !== s ? isValid(news) : false;
};